#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <iostream>
#include <cstring>
using namespace std;

class Student
{
	char* name;
	char* id;
	int grade;
public:
	Student(const char* Name = "***", const char* Id = "000", int Grade = 0);
	void output()
	{
		cout << "Name:" << name << " id:" << id << " grade:" << grade << endl;
	}

	void setValues(const char* r = "***", const char* y = "000", int sc = 0);

};
Student::Student(const char* Name, const char* Id, int Grade)
{
	int len1 = strlen(Name);
	name = new char[len1 + 1];
	strcpy(name, Name);
	int len2 = strlen(Id);
	id = new char[len2 + 1];
	strcpy(id, Id);
	grade = Grade;
}
void Student::setValues(const char* r, const char* y, int sc) {
	int len = strlen(r);
	name = new char[len + 1];
	strcpy(name, r);
	int len2 = strlen(y);
	id = new char[len2 + 1];
	strcpy(id, y);
	grade = sc;

}
class ArrayOfStudent
{
	int size;
	Student* p;
public:
	Student& element(int i)
	{
		return p[i];
	}
	ArrayOfStudent(int ct)
	{
		size = ct;
		p = new Student[size + 1];
	}
	~ArrayOfStudent()
	{
		cout << "Deleting...";
	}

}; 
